﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using RB.Web.Security;
using System.ServiceModel.Activation;
using System.Web;

namespace CSF.JobNotifier.Service
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“Service1”。
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class SecurityService : ISecurityService
    {

        public string Login(string userName, string password)
        {
            bool auth = VarAuthentication.Authenticate(userName, password, true);
            if (auth)
            {
                VarIdentity identity = (VarIdentity)HttpContext.Current.User.Identity;
                return identity.Ticket;
            }
            return null;
        }
    }
}
